Blockly.JavaScript = Blockly.Generator.get('JavaScript');

Blockly.Language.gamedu_move = {
	// Block for moving forward or backward.
	helpUrl : 'http://code.google.com/p/blockly/wiki/Move',
	init : function() {
		this.setColour(290);
		this.appendDummyInput()
		 	.appendTitle("Move truck to ")
			.appendTitle(new Blockly.FieldDropdown(this.DIRECTIONS), 'DIR');
		this.setPreviousStatement(true);
		this.setNextStatement(true);
		 this.setInputsInline(true);
		this.setTooltip(Blockly.MSG_MOVETOOLTIP);
	}
};


Blockly.Language.gamedu_move.DIRECTIONS = [[Blockly.MSG_MOVELEFT, 'moveLeft'],[Blockly.MSG_MOVERIGHT, 'moveRight']];

Blockly.JavaScript.gamedu_move = function() {
	var object = 1752;
	return 'gamedugame.blockly.' + this.getTitleValue('DIR') + '(\'' + this.id +'\',' +object+ ');\n';
};


Blockly.Language.gamedu_shoot = {
	// Block for moving forward or backward.
	helpUrl : 'http://code.google.com/p/blockly/wiki/Move',
	init : function() {
		this.setColour(290);
		
		this.appendDummyInput()
			.appendTitle(Blockly.MSG_SHOOT);
		this.setPreviousStatement(true);
		this.setNextStatement(true);
		 this.setInputsInline(true);
		this.setTooltip('');
	}
};


Blockly.JavaScript.gamedu_shoot = function() {
	var object = 1753;	
	return 'gamedugame.blockly.shoot (\'' + this.id +'\',' +object+ ');\n';
};

